`ifndef UVM_CORESERVICE_SVH
`define UVM_CORESERVICE_SVH

typedef class uvm_factory;
typedef class uvm_root;

class uvm_coreservice_t;
	local static uvm_coreservice_t inst;
	local uvm_factory factory;

	static function uvm_coreservice_t get(); // 获取uvm_coreservice_t的唯一实例
		if(inst == null) begin
			inst = new(); // 创建uvm_coreservice_t的唯一实例
			$display("%s(%0d) create a unique object of singleton class uvm_coreservice_t", `__FILE__, `__LINE__);
		end
		return inst;
	endfunction

	virtual function uvm_factory get_factory(); // 获取uvm_factory的唯一实例
		if(factory == null) begin
			uvm_factory f;
			f = new(); // 创建uvm_factory的唯一实例
			$display("%s(%0d) create a unique object of singleton class uvm_factory", `__FILE__, `__LINE__);
			factory = f;
		end
		return factory;
	endfunction

	virtual function uvm_root get_root(); // 获取uvm_root的唯一实例
		$display("%s(%0d) call %m", `__FILE__, `__LINE__);
		return uvm_root::m_uvm_get_root();
	endfunction
endclass

`endif
